#include<iostream>
using namespace std;
const int size=10;
template <class stacktype> class stack
{
stacktype stck[size];
int tos;
public:
stack(){tos=-1;}
void push(stacktype ob);
stacktype pop();
};
template <class stacktype> void stack<stacktype>::push(stacktype ob)
{
if(tos==size-1)
{
cout<<"stack is full\n";
}
else

stck[tos++]=ob;
}
template <class stacktype> stacktype stack<stacktype>::pop()
{
if(tos==-1);
{
cout<<"stack is empty\n";
}
return stck[tos--];

}
int main()
{
stack<char> s1,s2;
int i;

s1.push('a');
s2.push('x');
s1.push('b');
s2.push('y');
s1.push('c');
s2.push('z');
for(i=0;i<3;i++)
cout<<"pop s1 "<<s1.pop()<<"\n ";
for(i=0;i<3;i++)
cout<<"pop s2 "<<s2.pop()<<"\n ";
stack<int> m,n;
m.push(1);
n.push(2);
m.push(3);
n.push(4);
m.push(5);
n.push(6);
for(i=0;i<3;i++)
{
cout<<"pop m "<<m.pop()<<" ";
}
for(i=0;i<3;i++)
{
cout<<"pop n "<<n.pop()<<" ";
}
return 0;
}



